import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ServiceQualityStatisticsVO, ServiceQualityStatisticsForm, ServiceQualityStatisticsQuery } from '@/api/nursing/serviceQualityStatistics/types';

/**
 * 查询服务质量统计列表
 * @param query
 * @returns {*}
 */

export const listServiceQualityStatistics = (query?: ServiceQualityStatisticsQuery): AxiosPromise<ServiceQualityStatisticsVO[]> => {
  return request({
    url: '/nursing/serviceQualityStatistics/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询服务质量统计详细
 * @param statId
 */
export const getServiceQualityStatistics = (statId: string | number): AxiosPromise<ServiceQualityStatisticsVO> => {
  return request({
    url: '/nursing/serviceQualityStatistics/' + statId,
    method: 'get'
  });
};

/**
 * 新增服务质量统计
 * @param data
 */
export const addServiceQualityStatistics = (data: ServiceQualityStatisticsForm) => {
  return request({
    url: '/nursing/serviceQualityStatistics',
    method: 'post',
    data: data
  });
};

/**
 * 修改服务质量统计
 * @param data
 */
export const updateServiceQualityStatistics = (data: ServiceQualityStatisticsForm) => {
  return request({
    url: '/nursing/serviceQualityStatistics',
    method: 'put',
    data: data
  });
};

/**
 * 删除服务质量统计
 * @param statId
 */
export const delServiceQualityStatistics = (statId: string | number | Array<string | number>) => {
  return request({
    url: '/nursing/serviceQualityStatistics/' + statId,
    method: 'delete'
  });
};
